<?php

require_once 'conexion.php';

$sql="select * from provincias";
//echo $sql;
$res = mysql_query ($sql, $conexion);
if(mysql_affected_rows()>0){
	while($row = mysql_fetch_array($res)){
		$datos []= array("id" => $row["id_provincia"], "literal" => utf8_encode($row["provincia"])) ;
	}
}else{
	$datos []= array("id" => 0, "literal" => "") ;
}
echo json_encode($datos);
?>